home *** CD-ROM | disk | FTP | other *** search
/ Graphics & Sound Program…ng Techniques for the Mac / Graphics and Sound Programming Techniques for the Mac.iso / M&T Graphics & Sound Examples / Metrowerks Versions / C06 QuickDraw GX / READ ME QuickDraw GX
Encoding:
Text File  |  1995-08-31  |  1.8 KB  |  27 lines  |  [TEXT/ttxt]

  1. READ ME QuickDraw GX
  2.  
  3. __________________________________________________________
  4.  
  5. In order for the Chapter 6 examples to run, you must have the QuickDraw GX extension in the Extensions folder of your Mac's System Folder. QuickDraw GX is a part of System 7.5. If you installed System 7.5, but didn't install QuickDraw GX, use your install disks to add it to your system.
  6.  
  7. __________________________________________________________
  8.  
  9. Notice that the QuickDraw GX header files that are included in a project are nested between #pragmas. You need to place the header files between these pragmas. The following is an example. If you want an explanation, read on. If you don't want an explanation, that's okay. But you still _need_ to use these #pragmas in your code!
  10.  
  11. #ifndef powerc
  12.    #pragma pointers_in_D0        
  13. #endif
  14.  
  15. #include "PrintingManager.h"
  16. #include "graphics macintosh.h"
  17. #include "graphics libraries.h"
  18.  
  19. #ifndef powerc
  20.    #pragma pointers_in_A0
  21. #endif
  22.  
  23. The #ifndef powerc means "if the constant powerc is _not_ defined, execute the following code." The "following code" is the #pragma directive. The effect is that when compiling with the 68K compiler, the #pragma statements will be executed. When compiling with the PowerPC compiler, the #pragma statements won't be executed.
  24.  
  25. Why does QuickDraw GX code compiled with a Metrowerks 68K compiler need these two #pragmas? These two #pragmas let you choose between two calling conventions. QuickDraw GX Toolbox functions normally return pointers in the D0 register. Metrowerks uses a convention that returns pointers in the A0 register. By using pointers_in_D0, you tell the 68K compiler to do things "the Toolbox way" for the routines listed in the #include files. After the #include files are listed, the second #pragma (pointers_in_A0) tells the 68K compiler to go back to doing things "the Metrowerks way."
  26.  
  27.